<template>
  <div id="mSaveModal" v-if="saveToggle" @click.self="saveMask">
    <div class="modal-box">
      <div class="modal-close" @click="maskClose">
        <Icon type="ios-close-circle-outline" size="40" />
      </div>
      <h3>确定切换机组控制状态吗 ？</h3>
      <h4>
        <Button type="primary" @click="confirmSave">确 定</Button>
      </h4>
    </div>
  </div>
</template>

<script>
  export default {
    name: 'mSaveModal',
    props: {
      // modal 保存弹窗的显示隐藏
      saveToggle: {
        type: Boolean,
        default: false
      }
    },
    watch: {},
    data () {
      return {}
    },

    created () {

    },
    mounted () {

    },
    computed: {},
    methods: {
      // 关闭 弹窗的 方法
      maskClose () {
        this.$emit('maskClose')
      },
      saveMask () {
        this.$emit('saveMask')
      },
      confirmSave () {
        this.$emit('confirmSave')
      }
    },
    destroyed () {

    },
    components: {}
  }
</script>

<style lang='scss' scoped>
  #mSaveModal {
    @include modalFixed;
    .modal-box {
      width: 400px;
      height: 226px;
      background-color: rgba(20, 38, 89, 1);
      color: $font-f;
      position: relative;
      .modal-close {
        position: absolute;
        top: -20px;
        right: -20px;
        z-index: 99999;
        &:hover {
          cursor: pointer;
        }
      }
      h3 {
        width: 60%;
        margin: 50px auto;
        text-align: center;
        font-size: 18px;
      }
      h4 {
        width: 250px;
        margin: 50px auto;
        text-align: center;
        .ivu-btn-primary {
          width: 150px;
          background-color: #4c90fd;
          height: 30px;
          font-size: 18px;
          &:hover {
            background-color: #57a3f3;
          }
        }
      }
    }
  }
</style>
